/************************************************************
* author: alexander.aivars <alexander.aivars&#64;svt.se>
* $Date:2007-12-19 11:39:12 +0100 (Wed, 19 Dec 2007) $
* $Revision:196 $
* $HeadURL:svn://stoiis03.internt.svt.se/SVTiFLASH/trunk/SVTSE/Source/Classes/se/svt/events/ScrollEvent.as $
* $Id:ScrollEvent.as 196 2007-12-19 10:39:12Z alai $
************************************************************/
package se.svt.events
{
	import flash.events.Event;
	import flash.geom.Point;
	
	public class ScrollEvent extends Event
	{
		public static const SCROLL_START:String	= "scrollStart";
		public static const SCROLL_STOP:String	= "scrollStop";
		public static const SCROLL:String	= "scroll";
		
		private var _position:Number;
		private var _delta:Number;
		

		/**
		 * Gets the size of the change in scroll position, in pixels.
		 * @return 
		 * 
		 */
		public function get delta():Number { return _delta; }
		
		/**
		 * Gets the current scroll position, in pixels.
		 * @return 
		 * 
		 */
		public function get position():Number { return _position; }

		/**
		 * Creates a new ScrollEvent object with the specified parameters.
		 * @param type
		 * @param position
		 * @param delta
		 * @param bubbles
		 * @param cancelable
		 * 
		 */
		public function ScrollEvent(type:String,position:Number,delta:Number=0,bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			_position = position;
			_delta = delta;
		}
		
		/**
		 * Returns a string that contains all the properties of the ScrollEvent object.
		 * @return 
		 * 
		 */
		override public function toString():String {
			return formatToString("ScrollEvent", "position:"+position.toString(),"delta:"+delta.toString(),  "bubbles", "cancelable");
		}

		/**
		 * Creates a copy of the ScrollEvent object and sets the value of each parameter to match the original.
		 * @return 
		 * 
		 */
		override public function clone():Event {
			return new ScrollEvent(type, _position,_delta, bubbles, cancelable);
		}
	}
}